home *** CD-ROM | disk | FTP | other *** search
- /*
- ** SelectSequence.rexx for DirectoryOpus 4
- **
- ** written by Marcin Orlowski <carlos@dedal.man.szczecin.pl>
- ** <http://dedal.man.szczecin.pl/~carlos>
- **
- ** $VER 1.1
- **
- ** Brief: This script lets you easily select file sequences.
- ** Usage: Just select one file out of the sequence and call this script.
- ** SetUp: Copy this script whereever on your disk (suggested DOpus:Rexx or REXX:Dopus)
- ** and then add button (menu, hotkey):
- **
- ** (ARexx) REXX:DOpus/SelectSequence.rexx
- **
- ** Limitations: This scripts requires that the sequence is named using the following
- ** format: AAAAAA.XXX where AAAAA means any character (letter, digit)
- ** XXX means digits. The dot separator (.) may be replaced by any char
- ** but NON-DIGIT! Sequence named XXX only (eg: 0001, 0002...) will be
- ** processed correctly.
- **
- ** © W.F.M.H. v1.0 - Mon Jun 17 14:32:14 1996
- ** v1.1 - Sat Jun 22 12:22:37 1996
- */
-
- OPTIONS RESULTS
-
- DOPUSToFront
-
- Status 3 /* get number of the active window */
- ActiveWindow = RESULT
-
- GetSelectedFiles '"/"' ActiveWindow
- SelectedFiles = RESULT || "/"
-
- WordStart = 1
- WordEnd = 2
-
- Status 7 ActiveWindow /* how many selected files in the active window */
- Licznik = RESULT
-
- SAY licznik
-
- IF Licznik > 0 THEN
- DO Licznik
- WordEnd = POS('/', SelectedFiles, WordEnd);
- FileName = SUBSTR(SelectedFiles, WordStart, WordEnd-WordStart)
- NameLen = LENGTH(FileName)
-
- WordEnd = WordEnd + 1
- WordStart = WordEnd
-
- DO DotPos = NameLen TO 1 BY -1
- IF DATATYPE(SUBSTR(FileName, DotPos, 1), N) = 0 THEN LEAVE
- END
-
- DO
- BaseName = LEFT(LEFT(FileName, DotPos), NameLen, '?')
- 'Select 'BaseName' 'ONLYFILES''
- END
- END
- ELSE
-
- TopText "Select any file first!"
-